package com.bishe.demo.modules.other.dao;

import com.bishe.demo.modules.other.entity.SceneryMessage;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface SceneryMessageDao {
    @Insert("insert into other_scenery_message values(null,#{sceneryId},#{messageId})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    void insertSceneryMessage(SceneryMessage sceneryMessage);

    @Delete("delete from other_scenery_message where scenery_id=#{sceneryId}")
    void deletesSceneryMessageBySceneryId(int sceneryId);

    @Delete("delete from other_scenery_message where message_id=#{messageId}")
    void deleteSceneryMessageByMessageId(int messageId);
}
